
<%@page import="com.serviceBeans.PlaceMyAd"%>
<%@page import="com.spring.BusinessComponents.DoTransaction"%>
<%@page import="java.util.Date"%>

<%@page import="java.io.PrintWriter"%>
<%@page import="org.springframework.context.support.ClassPathXmlApplicationContext"%><%

System.out.println("MyRoomMate Service");
PrintWriter pw = response.getWriter();
DoTransaction doTransaction = null;
try {
	ClassPathXmlApplicationContext ctx = (ClassPathXmlApplicationContext) getServletContext()
			.getAttribute("ctx");
	doTransaction = (DoTransaction)ctx.getBean("doTransaction");
	PlaceMyAd placemyAd = new PlaceMyAd();

	String name = request.getParameter("name");
	String country = request.getParameter("country");
	String adTitle = request.getParameter("adTitle");
	String gender = request.getParameter("gendar");
	String contactNumber = request.getParameter("contatNumber");
	String contactEmail = request.getParameter("contactEmail");
	String description = request.getParameter("description");
	String city = request.getParameter("city");
	String state = request.getParameter("state");

	placemyAd.setAdTitle(adTitle);
	placemyAd.setContactEmail(contactEmail);
	placemyAd.setContactNumber(contactNumber);
	placemyAd.setCountry(country);
	placemyAd.setDescription(description);
	placemyAd.setGender(gender);
	placemyAd.setName(name);
	placemyAd
			.setPlacedDate(new java.sql.Timestamp(new Date().getTime()));
	placemyAd.setCity(city);
	placemyAd.setState(state);

	doTransaction.savePlacemyAdData(placemyAd);

} catch (Exception e) {
	doTransaction.saveException(com.general.genericUtils.BuildExceptionTrace.buildAndGiveExceptionTrace(e));
}

%>